<template>
  <section>
    <div class="default"></div>
    <div class="sticky"
         :style="{width:isCollapse?'calc(100% - 84px)':'calc(100% - 180px)'}">
      <slot />
    </div>
  </section>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
  name: 'ym-sticky',
  data () {
    return {}
  },
  computed: {
    ...mapGetters([
      'sidebar',
    ]),
    isCollapse () {
      return !this.sidebar.opened
    },
  }
}
</script>
<style lang="scss" scoped>
.default {
  height: 50px;
}
.sticky {
  position: fixed;
  bottom: 0;
  height: 50px;
  background: #fff;
  width: calc(100% - 50px);
  box-shadow: 0 -5px 10px #f1f1f1;
  box-sizing: border-box;
  padding: 0 10px;
  display: flex;
  align-items: center;

  border-radius: 8px 8px 0 0;
}
</style>
